package javase_class_250907;

/**
 * ClassName: User
 * Package: javase_class_250907
 * Description:
 *
 * @Author harkjeans
 * @Create 2025/9/7 12:36
 * @Version 1.0
 */
public class User {
    private String username;
    private String password;
    private long registrationTime;

    public void setUsername(String username) {
        this.username = username;
    }

    public String getUsername() {
        return username;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getPassword() {
        return password;
    }

    public long getRegistrationTime() {
        return registrationTime;
    }

    {
        System.out.println("新用户注册");
        registrationTime = System.currentTimeMillis();
    }

    public User(){
        username = registrationTime + "";
        password = "123456";
    }
    public User(String username, String password){
        this.username = username;
        this.password = password;
    }

    public String getInfo(){
        return "用户名：" + username + "，密码：" + password + "，注册时间：" + registrationTime;
    }

}
